import json
#持久化存储


#1.序列化
# with open("data.json","w",encoding="utf-8") as f:
#     data = {'name': "yuan", 'age': 18, "is_married": False, "gf": None}
#     data_json = json.dumps(data)
#     f.write(data_json)

#2.反序列化
with open("data.json","r",encoding="utf-8") as f:
    data_json = f.read()
    data_dict = json.loads(data_json)
    print(data_dict,type(data_dict))
